<template>
  <Card :tab-list="tabListTitle" v-bind="$attrs" :active-tab-key="activeKey" @tabChange="onTabChange" title="局放趋势">
    <p v-if="activeKey === 'tab1'">
      <VisitAnalysis />
    </p>
    <p v-if="activeKey === 'tab2'">
      <VisitAnalysisBar />
    </p>
  </Card>
</template>
<script lang="ts" setup>
  import { ref } from 'vue';
  import { Card } from 'ant-design-vue';
  import VisitAnalysis from './VisitAnalysis.vue';
  import VisitAnalysisBar from './VisitAnalysisBar.vue';
  import {defHttp} from "@/utils/http/axios";

  const activeKey = ref('tab1');

  const tabListTitle = [
    {
      key: 'tab1',
      tab: '曲线趋势',
    },
    {
      key: 'tab2',
      tab: '柱状趋势',
    },
  ];

  function onTabChange(key) {
    activeKey.value = key;
  }
  // 从后台获取数据
 /* const dataFromBackend = ref(Object);
  defHttp.get({url:"/yc/web/ycAlarmReport/recordCountWithTime"}).then(data =>{
    dataFromBackend.value = data;
  });*/
</script>
